﻿<script src="@Url.Content("~/Scripts/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine-es.js")" type="text/javascript" charset="utf-8"></script>
    <script src="@Url.Content("~/Scripts/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine.js")" type="text/javascript" charset="utf-8"></script>
@using CHILIS.Componentes.CoreRestaurant.Model.Adquicisiones;
@{
    List<AD_Insumo> listadoInsumos = (List<AD_Insumo>)ViewBag.ListadoInsumos;
    int nroSol = -1;
    int codIns = -1;
    int cantidad = -1;

    if (ViewBag.NroSol != null)
    {
        nroSol = (int)ViewBag.NroSol;
    }

    if (ViewBag.NroSol != null)
    {
        codIns = (int)ViewBag.IdInsumo;
    }

    if (ViewBag.Cantidad != null )
    {
        cantidad = (int)ViewBag.Cantidad;
    }
}
<div>
    <div class="span2">
        <div class="control-group">
            <div class="controls">
                <input type="button" class="btn btn-info" id="buscarInsumo" value="Buscar" />
            </div>
        </div>
    </div>
    <div class="span3">
        <div class="control-group">
            <label class="control-label" for="mantTipo">
                Insumo</label>
            <div class="controls">
                <select class="idInsumo" name="idInsumo" id="idInsumo">
                    <option>SELECCIONE</option>
                    @foreach (var item in listadoInsumos)
                    {
                        if (codIns == item.Codigo_Insumo)
                        {
                        <option value="@item.Codigo_Insumo" selected="selected">@item.Descripcion_Insumo</option>
                        }
                        else
                        {
                        <option value="@item.Codigo_Insumo">@item.Descripcion_Insumo</option>
                        }

                    }
                </select>
            </div>
        </div>
    </div>
    <div class="span3">
        <div class="control-group">
            <label class="control-label" for="cantidadInsumo">
                Cantidad</label>
            <div class="controls">
                @if (cantidad != -1)
                {
                    <text>
                    <input type="text" class="cantidadInsumo input-small validate[required]" id="cantidadInsumo" name="cantidadInsumo"
                               placeholder="Cantidad" value="@cantidad"/>
                    </text>
                }
                else
                {
                    <text>
                    <input type="text" class="cantidadInsumo input-small validate[required]" id="cantidadInsumo" name="cantidadInsumo"
                        placeholder="Cantidad" />
                    </text>
                }
            </div>
        </div>
    </div>
</div>
<input type="hidden" class="hidNumSol" id="hidNumSol" name="numSol" value="@nroSol"/>
<input type="hidden" class="hidIdInsumoOld" id="hidIdInsumoOld" name="idInsumoOld" value="@codIns"/>



